@extends('backend::layout')
@section('title',$page_title)
@section('content')
    <table class="table table-bordered table-striped tbody info-card">
        <tbody>
        @foreach($count as $item)
            <tr>
{{--                <td>{{get_currency('id')[1]}}{{$item['inout']==0?'累计减少':'累计增加'}}</td>--}}
                <td>{{get_currency('id')[2]}}{{$item['inout']==0?'累计减少':'累计增加'}}</td>
{{--                <td>{{get_currency('id')[3]}}{{$item['inout']==0?'累计减少':'累计增加'}}</td>--}}
{{--                <td>{{get_currency('id')[4]}}{{$item['inout']==0?'累计减少':'累计增加'}}</td>--}}
            </tr>
            <tr>
{{--                    <td>{{$item['money1'] ?? 0}}</td>--}}
                <td>{{$item['money2'] ??0}}</td>
{{--                td>{{$item['money3'] ??0}}</td><td>{{$item['money4'] ??0}}</td>--}}
            </tr>
        @endforeach
        </tbody>
    </table>
    @if(isset($search))
        {{$search->render()}}
    @endif
    @component('backend::component.table.table-content')
        @slot('page_title') {{$page_title}} @endslot
        @slot('body_content')
            @if($list->isNotEmpty())
                <div class="table-responsive">
                    <table class="list table table-bordered table-striped">
                        <thead>
                        <tr>
                            <th>
                                @component('backend::component.checkbox')
                                    @slot('name') ids-all @endslot
                                @endcomponent
                            </th>
                            <th>时间</th>
                            <th>会员账号</th>
                            <th>金额</th>
                            <th>备注</th>
                        </tr>
                        </thead>
                        <tbody>
                        @foreach($list as $item)
                            <tr>
                                <td class="text-truncate">
                                    @component('backend::component.checkbox')
                                        @slot('name') id[] @endslot
                                        @slot('class') id @endslot
                                        @slot('value') {{$item->id}} @endslot
                                    @endcomponent
                                </td>
                                <td style="max-width: 100px;">{{$item->created_at}}</td>
                                <td class="text-truncate text-more-hide">
                                    账户:{{$item->target->user_number}}<br/>
                                    姓名:{{$item->target->real_name}}<br/>
                                    手机号:{{$item->target->user_phone}}
                                </td>
                                <td>
                                    @if($item->inout == 1)
                                        <span style="color: red;">+{{$item->money}}</span>
                                    @else
                                        -{{$item->money}}
                                    @endif
                                </td>
                                <td>{{sprintf($item->comment,'['.$item->target->real_name.']')}}</td>
                            </tr>
                        @endforeach
                        </tbody>
                    </table>
                    @slot('list_page')
                        {{$list->appends($search->getSearchData())->links('backend::public.pagination')}}
                    @endslot
                </div>
            @else
                @include('backend::public.empty_page',['info'=>'暂时没有校正明细'])
            @endif
        @endslot
    @endcomponent
@endsection